package com.eascs.web.o2o.web.aging.utils;

import java.util.List;

import com.eascs.app.dao.PageResult;

public class OverData {
	public static PageResult<Object[]> getOverData(PageResult<Object[]> agingInfoByPage, String flag) {
		List<Object[]> data = agingInfoByPage.getData();
		for (int i = 0, len = data.size(); i < len; i++) {
			if ("ZXOUT".equals(flag) || "ZSN".equals(flag)) {
				if (data.get(i)[3] == null || (Float)data.get(i)[3] <= 0) {
					data.remove(i);
					i--;
					len--;
					continue;
				}
			}
			if ("NSOUT".equals(flag) || "ZSN".equals(flag)) {
				if (data.get(i)[4] == null ||  (Float)data.get(i)[4] <= 0) {
					data.remove(i);
					continue;
				}
			}
			if ("SBOUT".equals(flag) || "ZSN".equals(flag)) {
				if (data.get(i)[5] == null ||  (Float)data.get(i)[5] <= 0) {
					data.remove(i);
					continue;
				}
			}
		}
		agingInfoByPage.setData(data);
		return agingInfoByPage;
	}
}
